package com.qiyuexinxi.chat.mapper;

import com.qiyuexinxi.chat.domain.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper {

    List<User> selectByUserIds(@Param("userIds") List<Integer> userIds);

    int selectChatCodeCount(@Param("chatCode") String chatCode);

    User selectUserByChatCodeCount(@Param("chatCode") String chatCode);

    User selectByPhone(@Param("phone") String phone);

    /**
     * 找回密码
     * @param phone
     * @param password
     * @return
     */
    int updateByPhone(@Param("phone") String phone,@Param("password") String password);

    int deleteByPrimaryKey(Integer userId);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer userId);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /**根据行表查用户list*/
    List<User> selectUserListBySex(String sex);

}